﻿using System;
using System.Collections.Generic;
using SobrietyEngine.Components;
using SobrietyEngine.Components.Common;
using SobrietyEngine.Components.Graphic;
using SobrietyEngine.Scene;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace SobrietyEngine.Actor.Builders.Model
{
    public class Model : BaseActorBuilder
    {
        public static IActor Build(IScene scene, Vector3 pos, Vector3 forward, Vector3 scale, String asset)
        {
            IActor actor = scene.CreateEmptyActor();
            actor.AttachComponent(new ScaleCmp(scale));
            actor.AttachComponent(new PositionCmp(pos));
            IOrientation o = new OrientationCmp();
            o.Set(forward);
            actor.AttachComponent((IComponent)o);
            actor.AttachComponent(new ModelCmp(asset));
            actor.Initialize();
            return actor;
        }
    }
}